home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / applic / ntp / doc / time.txt.Z / time.txt
Encoding:
Text File  |  1991-09-29  |  45.3 KB  |  851 lines

  1. @TITLE = On the Chronometry and Metrology of Computer Network Timescales
  2. and their Application to the Network Time Protocol<$FSponsored by:
  3. Defense Advanced Research Projects Agency under NASA Ames Research
  4. Center contract number NAG 2-638 and National Science Foundation grant
  5. number NCR-89-13623.>
  6.  
  7. @AUTHOR = David L. Mills
  8. Electrical Engineering Department
  9. University of Delaware
  10.  
  11. @AUTHOR = Abstract
  12.  
  13. @ABSTRACT = This paper summarizes issues in computer network timekeeping
  14. with respect to the Network Time Protocol, which is used to synchronize
  15. time in many of the hosts and gateways of the Internet. It describes the
  16. methods used to coordinate and disseminate international time services
  17. and how they are incorporated into NTP time servers. It discusses the
  18. hazards on reckoning NTP dates with the conventional civil calendar and
  19. a standard method for numbering the days. Finally, the paper describes
  20. the NTP timescale, its mapping to conventional civil time and date and
  21. its interpretation of leap seconds.
  22.  
  23. Keywords: network clock synchronization, standard time distribution,
  24. timescale coordination, leap seconds, Network Time Protocol.
  25.  
  26. @HEAD LEVEL 1 =  Introduction
  27.  
  28. Each year brings exotic new applications for precision timekeeping, such
  29. as measuring the density of the universe [RAW87] and calibrating global
  30. warming [SCI91]. Recent improvements in time-transfer technology have
  31. doubled the precisions attainable about every seven years to the current
  32. regime of better than a few nanoseconds over the global range. While
  33. inexpensive, ubiquitous time transfer using a global computer network
  34. ordinarily cannot approach such precisions, accuracies of a few tens of
  35. milliseconds have been demonstrated for most paths in the Internet of
  36. today [MIL90a].
  37.  
  38. Among the requirements for ubiquitous timekeeping in a global computer
  39. networking community is to provide a standard chronometry for precision
  40. dating of present and future events. This requires a standard
  41. interpretation of computer timekeeping media with respect to
  42. conventional civil time and date as disseminated by national means.
  43. Among the problems addressed must be the rationalization with the
  44. calendar, the ambiguity of presentation and the interpretation of leap
  45. seconds.
  46.  
  47. This paper consists of an extended discussion on computer network
  48. chronometry, which is the precise determination of computer time and
  49. frequency relative to international standards, and on calendar
  50. metrology, which is the determination of conventional civil time and
  51. date according to the modern calendar. It describes the methods
  52. conventionally used to establish civil time and date and the various
  53. timescales now in use. In particular, it characterizes the Network Time
  54. Protocol (NTP) timescale relative to the Coordinated Universal Time
  55. (UTC) timescale, and establishes the precise interpretation of UTC leap
  56. seconds in NTP.
  57.  
  58. In the following discussion the terms time, timescale, oscillator,
  59. clock, epoch, timestamp, calendar and date are used in a technical
  60. sense. Strictly speaking, the time of an event is an abstraction which
  61. determines the ordering of events in some given frame of reference or
  62. timescale. An oscillator is a generator capable of precise frequency
  63. (relative to the given timescale) within a specified tolerance. A clock
  64. is an oscillator together with a counter which records the (fractional)
  65. number of cycles since being initialized with a given value at a given
  66. time. The value of the counter at any given time t is called its epoch
  67. and recorded as the timestamp T(t) of that epoch. In general, epoches
  68. are not continuous and depend on the precision of the counter.
  69.  
  70. A calendar is a mapping from epoches in some timescale to the year-day
  71. dates used in everyday life. Since multiple calendars are in use today
  72. and sometimes disagree on the dating of the same epoches in the past,
  73. the metrology of past and present epoches is an art practiced by
  74. historians. However, the ultimate timescale for our world is based on
  75. cosmic oscillators, such as the Sun, Moon and other galactic orbiters.
  76. Since the frequencies of these oscillators are relatively unstable and
  77. not known exactly, the ultimate reference standard oscillator has been
  78. chosen by international agreement as a synthesis of many observations of
  79. an atomic transition of exquisite stability. The frequency of each
  80. heavenly and Earthbound oscillator defines a distinctive timescale, not
  81. necessarily always continuous, relative to that of the standard
  82. oscillator.
  83.  
  84. In this paper the stability of a clock is how well it can maintain a
  85. constant frequency, the accuracy is how well its time compares with
  86. national standards and the precision is to what degree time can be
  87. resolved in a particular timekeeping system. The time offset of two
  88. clocks is the time difference between them, while the frequency offset
  89. is the frequency difference between them. In this paper reference to
  90. simply <169>offset<170> means time offset, unless indicated otherwise.
  91. The reliability of a timekeeping system is the fraction of the time it
  92. can be kept connected to the network and operating correctly relative to
  93. stated accuracy and stability tolerances.
  94.  
  95. In order to synchronize clocks, there must be some way to directly or
  96. indirectly compare them in time and frequency. In network architectures
  97. such as DECnet and Internet local clocks are synchronized from
  98. designated time servers, which are timekeeping systems belonging to a
  99. synchronization subnet, in which each server measures the offsets
  100. between its local clock and the clocks of its neighbor servers or peers
  101. in the subnet. In this paper to synchronize frequency means to adjust
  102. the clocks in the subnet to run at the same frequency, to synchronize
  103. time means to set them to agree at a particular epoch with respect to
  104. Coordinated Universal Time (UTC), as provided by national standards, and
  105. to synchronize clocks means to synchronize them in both frequency and
  106. time.
  107.  
  108. @HEAD LEVEL 1 =  Network Time Protocol
  109.  
  110. The Network Time Protocol (NTP) is used by Internet time servers and
  111. their peers to synchronize clocks, as well as automatically organize and
  112. maintain the time synchronization subnet itself. It is evolved from the
  113. Time Protocol [POS83] and the ICMP Timestamp Message [DOD81a], but is
  114. specifically designed for high accuracy, stability and reliability, even
  115. when used over typical Internet paths involving multiple gateways and
  116. unreliable networks. The following sections contain an overview of the
  117. procedures and algorithms used in NTP. A formal description and error
  118. analysis of the protocol is contained in [MIL90b]. A detailed
  119. description of the NTP architecture and protocols is contained in
  120. [MIL91], while a summary of operational experience and performance is
  121. contained in [MIL90a].
  122.  
  123. NTP and its implementations have evolved and proliferated in the
  124. Internet over the last decade, with NTP Version 2 now adopted as an
  125. Internet Standard [MIL89] and NTP Version 3 proposed for adoption
  126. [MIL90b]. NTP is built on the Internet Protocol (IP) [DOD81b] and User
  127. Datagram Protocol (UDP) [POS80], which provide a connectionless
  128. transport mechanism; however, it is readily adaptable to other protocol
  129. suites. The protocol can operate in several modes appropriate to
  130. different scenarios involving private workstations, public servers and
  131. various network configurations. A lightweight association-management
  132. capability, including dynamic reachability and variable poll-interval
  133. mechanisms, is used to manage state information and reduce resource
  134. requirements. Optional features include message authentication based on
  135. crypto-checksums and provisions for remote control and monitoring.
  136.  
  137. In NTP one or more primary servers synchronize directly to external
  138. reference sources such as radio clocks. Secondary time servers
  139. synchronize to the primary servers and others in the synchronization
  140. subnet. A typical subnet is shown in Figure 1a, in which the nodes
  141. represent subnet servers, with normal level numbers determined by the
  142. hop count to the root, and the heavy lines the active synchronization
  143. paths and direction of timing information flow. The light lines
  144. represent backup synchronization paths where timing information is
  145. exchanged, but not necessarily used to synchronize the local clocks.
  146. Figure 1b shows the same subnet, but with the line marked x out of
  147. service. The subnet has re-configured itself automatically to use backup
  148. paths, with the result that one of the servers has dropped from stratum
  149. 2 to stratum 3. In practice each NTP server synchronizes with several
  150. other servers in order to survive outages and Byzantine failures using
  151. methods similar to those described in [SHI87]
  152.  
  153. Figure 2<$&fig2> shows the overall organization of the NTP time-server
  154. model, which has much in common with the phase-lock methods summarized
  155. in [RAM90]. Timestamps exchanged between the server and possibly many
  156. other subnet peers are used to determine individual roundtrip delays and
  157. clock offsets, as well as provide reliable error bounds. Figure
  158. 3<$&fig3> shows how NTP timestamps are numbered and exchanged between
  159. peers A and B. Let <$ET sub i>, <$ET sub {i-1}>, <$ET sub {i-2}>, <$ET
  160. sub {i-3}> be the values of the four most recent timestamps as shown and
  161. let
  162.  
  163. @CENTER = <$Ea~=~T sub {i-2}~-~T sub {i-3}>    and    <$Eb~=~T sub {i-
  164. 1}~-~T sub i>.
  165.  
  166. If the network delays from A to B and from B to A are similar, the
  167. roundtrip delay <$Edelta> and clock offset <$Etheta> of B relative to A
  168. at time <$ET sub i> are:
  169.  
  170. @CENTER = <$Edelta~=~a~-~b>    and    <$Etheta~=~{a~+~b} over 2>.
  171.  
  172. Each NTP message includes the latest three timestamps <$ET sub {i-1}>,
  173. <$ET sub {i-2}> and <$ET sub {i-3}>, while the fourth timestamp <$ET sub
  174. i> is determined upon arrival of the message. Thus, both the server and
  175. the peer can independently calculate delay and offset using a single
  176. bidirectional message stream. This is a symmetric, continuously sampled,
  177. time-transfer scheme similar to those used in some digital telephone
  178. networks [LIN80]. Among its advantages are that the transmission times
  179. and received message orders are unimportant and that reliable delivery
  180. is not required.
  181.  
  182. As shown in Figure 2, the computed delays and offsets for each peer are
  183. processed by the data-filter algorithm to reduce incidental timing
  184. noise. As described in [MIL90b], this algorithm selects from among the
  185. last several samples the one with minimum <$Edelta> and presents the
  186. associated <$Etheta> as the output. The peer-selection algorithm
  187. determines from among all peers a suitable subset of peers capable of
  188. providing the most accurate and trustworthy time using principles
  189. similar to those described in [VAS88]. In NTP this is done using a
  190. cascade of two subalgorithms, one a version of an algorithm proposed in
  191. [MAR85] and the other based on maximum likelihood principles to improve
  192. accuracy [MIL91].
  193.  
  194. The resulting offsets of this subset are first combined on a weighted-
  195. average basis using an algorithm similar to that described in [JON83]
  196. and then processed by a phase-lock loop (PLL). In the PLL the combined
  197. effects of the filtering, selection and combining operations are to
  198. produce a phase-correction term, which is processed by the loop filter
  199. to control the local clock, which functions as a voltage-controlled
  200. oscillator (VCO). The VCO furnishes the timing (phase) reference to
  201. produce the timestamps used in all timing calculations.
  202.  
  203. @HEAD LEVEL 1 =  Methods for Time and Frequency Synchronization
  204.  
  205. The primary servers of a synchronization subnet must themselves
  206. synchronize to a source of standard time, such as a radio clock or
  207. telephone modem. It is of considerable interest to explore how this can
  208. be done and what accuracies can be expected. The following sections
  209. discuss issues involved in providing accurate and stable reference
  210. sources using national means of dissemination.
  211.  
  212. @HEAD LEVEL 2 =  Time and Frequency Standards
  213.  
  214. A primary frequency standard is an oscillator that can maintain
  215. extremely precise frequency relative to a physical phenomenon, such as a
  216. transition in the orbital states of an electron. Presently available
  217. atomic oscillators are based on the transitions of the hydrogen, cesium
  218. and rubidium atoms. Table 1<$&tab1> shows the characteristics for
  219. typical oscillators of these types compared with those for various types
  220. of quartz-crystal oscillators found in electronic equipment. Present
  221. practice is to operate multiple cesium-based clocks at national
  222. standards laboratories and coordinate their readings using satellite-
  223. based time-transfer methods. On the other hand, local clocks used in
  224. computing equipment almost always are designed with uncompensated quartz
  225. oscillators.
  226.  
  227. For the three atomic oscillators listed in Table 1 the Drift/Aging
  228. column shows the maximum offset from nominal standard frequency due to
  229. systematic mechanical and electrical characteristics. In the case of
  230. quartz oscillators (oven-controlled, digital-temperature-compensated,
  231. analog-temperature-compensated or uncompensated) this offset is not
  232. constant, which results in a gradual change in frequency with time,
  233. called aging. Even if a quartz oscillator is temperature compensated by
  234. some means, it must be periodically compared to a primary standard in
  235. order to maintain the highest accuracy. For all types of oscillators the
  236. stability column shows the maximum variation in frequency per day due to
  237. circuit noise and environmental factors.
  238.  
  239. As the telephone networks of the world are evolving rapidly to digital
  240. technology, consideration should be given to the methods used for
  241. synchronization in digital networks [BEL86]. A network of clocks in
  242. which each oscillator is phase-locked to a single frequency standard is
  243. called isochronous, while a network in which some oscillators are phase-
  244. locked to different master oscillators, but with the master oscillators
  245. closely synchronized in frequency (not necessarily phase-locked), to a
  246. single frequency standard is called plesiochronous. The NTP
  247. synchronization subnet operating in the Internet is a plesiochronous
  248. system in which multiple primary time servers synchronize using radio
  249. clocks and national broadcast services.
  250.  
  251. The industry has agreed on a classification of clock oscillators as a
  252. function of minimum accuracy, minimum stability and other factors
  253. [ALL74]. There are three factors which determine the classification:
  254. stability, jitter and wander. Stability refers to the systematic
  255. variation of frequency with time and is synonymous with aging, drift,
  256. trends, etc. Jitter (also called timing jitter) refers to short-term
  257. variations in frequency with components greater than 10 Hz, while wander
  258. refers to long-term variations in frequency with components less than 10
  259. Hz. The classification determines the oscillator stratum (not to be
  260. confused with the NTP stratum described previously), with the more
  261. accurate oscillators assigned the lower strata and less accurate
  262. oscillators the higher strata, as shown in Table 2<$&tab2>.
  263. The construction, operation and maintenance of stratum-one oscillators
  264. is assumed to be consistent with national standards and often includes
  265. cesium oscillators or precision quartz oscillators synchronized to
  266. national standards. Oscillators assigned higher strata represent the
  267. stability required for interexchange systems, exchange switches and PBX
  268. systems, respectively. With respect to this classification, most
  269. computer local clocks would be assigned stratum-four. These clocks are
  270. most often constructed using an uncompensated quartz oscillator with
  271. typical frequency tolerance of 10-5 and stability of 10-6 per day.
  272.  
  273. @HEAD LEVEL 2 =  Time and Frequency Dissemination
  274.  
  275. In order that atomic and civil time can be coordinated throughout the
  276. world, national administrations operate primary time and frequency
  277. standards and coordinate them cooperatively by observing various radio
  278. and satellite broadcasts and through occasional use of portable atomic
  279. clocks. Most seafaring nations of the world operate some sort of
  280. broadcast time service for the purpose of calibrating chronographs,
  281. which are used in conjunction with ephemeris data to determine
  282. navigational position. In many countries the service is primitive and
  283. limited to seconds-pips broadcast by marine communication stations at
  284. certain hours. For example, a chronograph error of one second represents
  285. a longitudinal position error of about 0.23 nautical mile at the
  286. Equator.
  287.  
  288. The U.S. National Institute of Standards and Technology (NIST - formerly
  289. National Bureau of Standards) operates three radio services for the
  290. dissemination of primary time and frequency information. One of these
  291. uses high-frequency (HF or CCIR band 7) transmissions from Fort Collins,
  292. CO (WWV), and Kauai, HI (WWVH). Signal propagation is usually by
  293. reflection from the upper ionospheric layers, which vary in height and
  294. density throughout the day and season and result in unpredictable
  295. amplitude and delay variations at the receiver. While these
  296. transmissions and those of Canada from Ottawa, Ontario (CHU), and other
  297. countries can be received over large areas in the western hemisphere,
  298. reliable frequency comparisons can be made only to the order of 10-7 and
  299. time accuracies are limited to the order of a millisecond [BLA74].
  300. Available radio clocks which operate with these transmissions provide
  301. accuracies to the order of ten milliseconds and are priced in the $1,500
  302. range.
  303.  
  304. A second service operated by NIST uses low-frequency (LF or CCIR band 5)
  305. transmissions from Boulder, CO (WWVB), and can be received over the
  306. continental U.S. and adjacent coastal areas. Signal propagation is via
  307. the lower ionospheric layers, which are relatively stable and have
  308. predictable diurnal variations in height. With appropriate receiving and
  309. averaging techniques and corrections for diurnal and seasonal
  310. propagation effects, frequency comparisons to within 10-11 are possible
  311. and time accuracies of from a few to 50 microseconds can be obtained
  312. [BLA74]. Some countries in western Europe operate similar services which
  313. use transmissions from Rugby, U.K. (MSF). Mainflingen, Germany (DCF77),
  314. and Allouis, France (France Inter). Available radio clocks which operate
  315. with these transmissions provide accuracies to the order of a
  316. millisecond and are priced in the $1,500 range.
  317.  
  318. The third service operated by NIST uses ultra-high frequency (UHF or
  319. CCIR band 9) transmissions from the Geosynchronous Orbit Environmental
  320. Satellites (GOES), and can be received over most of the western
  321. hemisphere. Available radio clocks which operate with these
  322. transmissions provide accuracies to the order of a millisecond and are
  323. priced in the $6,000 range.
  324.  
  325. Another service offered by NIST uses an ordinary telephone and modem
  326. [NBS88].  The service is intended for use by personal workstations to
  327. set clock-calendars, for example. However, in order to maintain an
  328. accuracy of a few milliseconds using an uncompensated quartz oscillator
  329. at typical limits of tolerance, it would be necessary to make a long-
  330. distance call every few minutes, which would not be suitable for a large
  331. population of clients calling on a regular basis without further
  332. redistribution.
  333.  
  334. The U.S. Department of Defense is developing the Global Positioning
  335. System (GPS) for worldwide precision navigation. This system will
  336. eventually provide 24-hour worldwide coverage using a constellation of
  337. 21 satellites in 12-hour orbits. For time-transfer applications GPS has
  338. a potential accuracy in the order of a few nanoseconds; however, various
  339. considerations of defense policy may limit accuracy to hundreds of
  340. nanoseconds [VAN84]. Available radio clocks provide accuracies to 100 ns
  341. and are priced in the $10,000 range.
  342.  
  343. There are several other navigation systems such as LORAN-C, operated by
  344. the U.S. Coast Guard and agencies of other countries, OMEGA, operated by
  345. the U.S. Navy, and various communication systems using very-low-
  346. frequency (VLF or CCIR band 4) transmissions. These systems can provide
  347. accuracies in the order from less than one to about fifty microseconds;
  348. however, the broadcast formats of these systems are not well suited for
  349. standard time distribution and the receivers have to be initialized with
  350. position information before use.
  351.  
  352. Note that not all transmission formats used by NIST radio broadcast
  353. services [NBS79] and not all currently available radio clocks include
  354. provisions for year information and leap-second warning. This
  355. information must be determined from other sources. NTP includes
  356. provisions to distribute advance warnings of leap seconds using the
  357. leap-indicator bits described in the NTP specification. The protocol is
  358. designed so that these bits can be set manually or by the radio clocks
  359. at the primary time servers and then automatically distributed
  360. throughout the synchronization subnet to all other time servers.
  361.  
  362. @HEAD LEVEL 1 =  Calendar Metrology
  363.  
  364. In the simplest terms a calendar system is a method to rationalize
  365. sightings of the Sun and Moon with certain religious and agricultural
  366. seasons which recur at characteristic frequencies. The various
  367. metrologies of the calendar amount to systems to assign day-numbers and
  368. sometimes day-names which determine the periodicity of these holy and
  369. secular oscillators. One might ask whether a (suitably disambiguated)
  370. NTP timestamp documenting the adventures of Alexander the Great merits
  371. the precision implied in its format. The following sections consider
  372. this issue in the light of the Western civil calendar and the
  373. establishment of a standard day-numbering plan.
  374.  
  375. @HEAD LEVEL 2 =  Evolution of the Calendar
  376.  
  377. The calendar systems used in the ancient world reflect the agricultural,
  378. political and ritual needs characteristic of the societies in which they
  379. flourished. Astronomical observations to establish the winter and summer
  380. solstices were in use three to four millennia ago [CAL86]. By the 14th
  381. century BC the Shang Chinese had established the solar year as 365.25
  382. days and the lunar month as 29.5 days. The lunisolar calendar, in which
  383. the ritual month is based on the Moon and the agricultural year on the
  384. Sun, was used throughout the ancient Near East (except Egypt) and Greece
  385. from the third millennium BC. Early calendars used either thirteen lunar
  386. months of 28 days or twelve alternating lunar months of 29 and 30 days
  387. and haphazard means to reconcile the 354/364-day lunar year with the
  388. 365-day vague solar year.
  389.  
  390. The ancient Egyptian lunisolar calendar had twelve 30-day lunar months,
  391. but was guided by the seasonal appearance of the star Sirius (Sothis).
  392. In order to reconcile this calendar with the solar year, a civil
  393. calendar was invented by adding five intercalary days for a total of 365
  394. days. However, in time it was observed that the civil year was about
  395. one-fourth day shorter than the actual solar year and thus would precess
  396. relative to it over a 1460-year cycle called the Sothic cycle. Along
  397. with the Shang Chinese, the ancient Egyptians had thus established the
  398. solar year at 365.25 days, or within about 11 minutes of the present
  399. determination. In 432 BC, about a century after the Chinese had done so,
  400. the Greek astronomer Meton calculated there were 110 lunar months of 29
  401. days and 125 lunar months of 30 days for a total of 235 lunar months in
  402. 6940 solar days, or just over 19 years. The 19-year cycle, called the
  403. Metonic cycle, established the lunar month at 29.532 solar days, or
  404. within about two minutes of the present determination.
  405.  
  406. The Roman republican calendar was based on a lunar year and by 50 BC was
  407. eight weeks out of step with the solar year. Julius Caesar invited the
  408. Alexandrian astronomer Sosigenes to redesign the calendar, which led to
  409. the adoption in 46 BC of the Julian calendar. This calendar is based on
  410. a year of 365 days with an intercalary day inserted every four years.
  411. However, for the first 36 years an intercalary day was mistakenly
  412. inserted every three years instead of every four. The result was 12
  413. intercalary days instead of nine, and a series of corrections that was
  414. not complete until 8 AD.
  415.  
  416. The seven-day Sumerian week was introduced only in the fourth century AD
  417. by Emperor Constantine I. During the Roman era a 15-year census cycle,
  418. called the Indiction cycle, was instituted for taxation purposes. The
  419. sequence of day-names for consecutive occurrences of a particular day of
  420. the year does not recur for 28 years, called the solar cycle. Thus, the
  421. least common multiple of the 28-year solar cycle, 19-year Metonic cycle
  422. and 15-year Indiction cycle results in a grand 7980-year supercycle
  423. called the Julian Era, which began in 4713 BC. A particular combination
  424. of the day of the week, day of the year, phase of the Moon and round of
  425. the census will recur beginning in 3268 AD.
  426.  
  427. By 1545 the discrepancy in the Julian year relative to the solar year
  428. had accumulated to ten days. In February 1582, following a plan
  429. originally devised by the astronomer Luigi Lilio, Pope Gregory XIII
  430. issued a papal bull which decreed that the day following Thursday, 4
  431. October 1582 on the old (Julian) calendar would be Friday, 15 October
  432. 1582 on the new (Gregorian) calendar and, furthermore, that the solar
  433. year would henceforth consist of 365.2425 days [MOY82]. In order to
  434. realize the new value, only those centennial years divisible by 400
  435. would be leap years, while the remaining centennial years would not,
  436. making the new year within about 24 seconds of the actual solar year at
  437. that time. Since the beginning of the Common Era and prior to 1990 there
  438. were 474 intercalary days inserted in the Julian calendar, but 14 of
  439. these were removed in the Gregorian calendar. While the Gregorian
  440. calendar is in use throughout most of the world today, some countries
  441. did not adopt it until early in the twentieth century.
  442.  
  443. While it remains a fascinating field for time historians, the above
  444. narrative provides conclusive evidence that conjugating calendar dates
  445. of significant events and assigning NTP timestamps to them is
  446. approximate at best. In principle, reliable dating of such events
  447. requires only an accurate count of the days relative to some globally
  448. alarming event, such as a comet passage or supernova explosion; however,
  449. only historically persistent and politically stable societies, such as
  450. the ancient Chinese and Egyptian, and especially the ancient Maya
  451. [MOR83], possessed the means and will to do so.
  452.  
  453. @HEAD LEVEL 2 =  The Modified Julian Day System
  454.  
  455. In order to measure the span of the universe or the decay of the proton,
  456. it is necessary to have a standard day-numbering plan. Accordingly, the
  457. International Astronomical Union has adopted the use of the standard
  458. second and Julian Day Number (JDN) to date cosmological events and
  459. related phenomena. The standard day consists of 86,400 standard seconds,
  460. where time is expressed as a fraction of the whole day, and the standard
  461. year consists of 365.25 standard days.
  462.  
  463. In the scheme devised in 1583 by the French scholar Joseph Justus
  464. Scaliger and named after his father, Julius Caesar Scaliger, JDN 0.0
  465. corresponds to 12h (noon) on the first day of the Julian Era, 1 January
  466. 4713 BC, and runs in days and fractions since then. The Modified Julian
  467. Date (MJD), which is sometimes used to represent dates near our own era
  468. in conventional time and with fewer digits, is defined as <$E roman
  469. MJD~=~roman JD~-~2,400,000.5>. While the JDN timescale is based on an
  470. absolute day numbering, it is not uniform relative to the absolute
  471. (atomic) timescale, since the Earth rotation is not constant and is
  472. gradually slowing down from 365.24232 days in 45 BC to 365.24219879 mean
  473. tropical days in the first year of our own century.
  474.  
  475. For historical purposes the years prior to the Common Era (BC) are
  476. reckoned according to the Julian calendar, while the years of the Common
  477. Era (AD) are reckoned according to the Gregorian calendar. Since Monday,
  478. 1 January 1 AD in the Gregorian calendar corresponds to Monday, 3
  479. January 1 in the Julian calendar [DER90], JDN 1,721,426.0 corresponds to
  480. 12h on the first day of the Common Era, 1 January 1 AD. Following the
  481. convention that our century began at 0h on 1 January 1900, at which time
  482. the solar year was already 12h old, that eclectic instant corresponds to
  483. MJD 15,020.0 and the origin of all existing Internet timescales,
  484. including that of NTP.
  485.  
  486. @HEAD LEVEL 1 =  Timescale Chronometry
  487.  
  488. International timescales are based on atomic clocks of exquisite
  489. stability compared to the astronomical clocks we normally live by.
  490. Occasionally, there is a need to correct the conventional civil
  491. timescale to account for unpredictable wobbles in Earth rotation and
  492. related phenomena. The following sections discuss these issues with
  493. respect to the NTP timescale; in particular, how it handles leap
  494. seconds.
  495.  
  496. @HEAD LEVEL 2 =  Determination of Frequency
  497.  
  498. For many years the most important use of time and frequency information
  499. was for worldwide navigation and space science, which depend on
  500. astronomical observations of the Sun, Moon and stars [TIM86]. Sidereal
  501. time is based on the transit of stars across the celestial meridian of
  502. an observer. The mean sidereal day is 23 hours, 56 minutes and 4.09
  503. seconds, but varies about <F128M>æ<F255D>30 ms throughout the year due
  504. to polar wandering and orbit variations. Ephemeris time is based on
  505. tables with which a standard time interval such as the tropical year -
  506. one complete revolution of the Earth around the Sun - can be determined
  507. through observations of the Sun, Moon and planets.
  508.  
  509. In 1958 the standard second was defined as 1/31,556,925.9747 of the
  510. tropical year that began this century. On this scale the tropical year
  511. in 1900 was 365.2421987 days and the lunar month - one complete
  512. revolution of the Moon around the Earth - was 29.53059 days; however,
  513. the actual tropical year can be determined only to an accuracy of about
  514. 50 ms and the mean value has been increasing by about 5.3 ms per year.
  515. Without correction for this factor, an NTP timestamp would be in error
  516. over 26 seconds at the dawn of recorded history.
  517.  
  518. Of the three heavenly oscillators readily apparent to ancient mariners
  519. and astronomers - the Earth rotation about its axis, the Earth
  520. revolution around the Sun and the Moon revolution around the Earth -
  521. none of the three have the intrinsic stability, relative to modern
  522. technology, to serve as a standard reference oscillator. In 1967 the
  523. standard second was redefined as <169>9,192,631,770 periods of the
  524. radiation corresponding to the transition between the two hyperfine
  525. levels of the ground state of the cesium-133 atom.<170> Prior to 0h 1
  526. January 1972 national frequency standards were occasionally corrected to
  527. agree with astronomical observations. Since then the time and frequency
  528. standards of the world have been based on International Atomic Time
  529. (TAI), which is defined and maintained using multiple cesium-beam
  530. oscillators to an accuracy of a few parts in 1013, or a few tens of
  531. nanoseconds per day. Note that, while this provides an extraordinarily
  532. precise timescale, it does not necessarily agree with conventional solar
  533. time and may not in fact even be absolutely uniform, unless subtle
  534. atomic conspiracies can be ruled out [RAW87].
  535.  
  536. @HEAD LEVEL 2 =  Determination of Time and Leap Seconds
  537.  
  538. The International Bureau of Weights and Measures (IBWM) uses
  539. astronomical observations provided by the U.S. Naval Observatory and
  540. other observatories to determine UTC. Starting from apparent mean solar
  541. time as observed, the UT0 timescale is determined using corrections for
  542. Earth orbit and inclination (the Equation of Time, as used by sundials),
  543. the UT1 (navigator's) timescale by adding corrections for polar
  544. migration and the UT2 timescale by adding corrections for known
  545. periodicity variations. While standard frequencies are based on TAI,
  546. conventional civil time is based on UT1, which is presently slowing
  547. relative to TAI by a fraction of a second per year. When the magnitude
  548. of correction approaches 0.7 second, a leap second is inserted or
  549. deleted in the TAI timescale on the last day of June or December.
  550.  
  551. For the most precise coordination and timestamping of events since 1972,
  552. it is necessary to know when leap seconds are implemented in UTC and how
  553. the seconds are numbered. As specified in CCIR Report 517, which is
  554. reproduced in [BLA74], a leap second is inserted following second
  555. 23:59:59 on the last day of June or December and becomes second 23:59:60
  556. of that day. A leap second would be deleted by omitting second 23:59:59
  557. on one of these days, although this has never happened. Leap seconds
  558. were inserted prior to 1 January 1990 on the occasions listed in Table
  559. 3<$&tab3> (courtesy U.S. Naval Observatory). Published IBWM corrections
  560. consist not only of leap seconds, which result in step discontinuities
  561. relative to TAI, but 100-ms UT1 adjustments called DUT1, which provide
  562. increased accuracy for navigation and space science.
  563.  
  564. Note that the NTP time column actually shows the epoch following the
  565. last second of the day given in the UTC date and MJD columns (except for
  566. the first line), which is the precise epoch of insertion. The offset
  567. column shows the cumulative seconds offset between the TAI timescale and
  568. the UTC timescale; that is, the number of seconds to add to the TAI
  569. clock in order to maintain nominal agreement with the UTC clock.
  570. Finally, note that the epoch of insertion is relative to the timescale
  571. immediately prior to that epoch; e.g., the epoch of the 31 December 1990
  572. insertion is determined on the timescale in effect following the 31
  573. December 1989 insertion, which means the actual insertion relative to
  574. the TAI clock was fifteen seconds later than the apparent time on the
  575. UTC timescale.
  576.  
  577. The UTC timescale thus ticks in standard (atomic) seconds and was set to
  578. the value 0h MJD 41,317.0 at the epoch determined by astronomical
  579. observation to be 0h on 1 January 1972 according to the Gregorian
  580. calendar; that is, the inaugural tick of the UTC Era. In fact, the
  581. inaugural tick which synchronized the cosmic oscillators, Julian clock,
  582. UTC clock and Gregorian calendar forevermore was displaced about ten
  583. seconds from the civil clock then in use, while the GPS clock is ahead
  584. of the UTC clock by seven seconds in early 1991. Subsequently, the UTC
  585. clock has marched backward relative to the Julian timescale exactly one
  586. second on scheduled occasions at monumental epoches embedded in the
  587. institutional memory of our civilization. Note in passing that leap-
  588. second adjustments affect the number of seconds per day and thus the
  589. number of seconds per year. Apparently, should we choose to worry about
  590. it, the UTC clock, Julian clock and various cosmic clocks will
  591. inexorably drift apart with time until rationalized by some future papal
  592. bull.
  593.  
  594. @HEAD LEVEL 2 =  The NTP Timescale and Reckoning with UTC
  595.  
  596. In NTP epoches are determined by copying the current value of the local
  597. clock to a timestamp variable when some significant event, such as the
  598. arrival of a message, occurs. Since NTP timestamps are cherished data
  599. and, in fact, represent the main product of the protocol, a special
  600. timestamp format has been established. An NTP timestamp is represented
  601. as a 64-bit unsigned fixed-point number, in seconds relative to 0h on 1
  602. January 1900. The integer part is in the first 32 bits and the fraction
  603. part in the last 32 bits. The precision of this representation is about
  604. 232 picoseconds, which should be adequate for even the most exotic
  605. requirements. Should NTP be in use when this 64-bit field overflows some
  606. time in 2036, external means will be necessary to qualify time relative
  607. to 1900 and time relative to 2036 (and other multiples of 136 years).
  608. Timestamped data requiring such qualification will be so precious that
  609. appropriate means should be readily available.
  610.  
  611. Since a large body of today's protocol architects expect to continue
  612. plying their trade as of 2036, some consideration as to the choice of
  613. format and origin of the NTP timescale may be in order. It is of course
  614. simple to mitigate the rollover problem simply by redefining the origin
  615. as, for example 2,272,060,800 or 1 January 1972, which results in a
  616. continuous timescale through all but the last two years of the next
  617. century. This does not, of course, change the interpretation of the NTP
  618. timestamp itself, just its representation in conventional civil time.
  619. Also, as will become evident shortly, in order to establish the most
  620. precise representation with respect to conventional civil time, it is
  621. necessary to retain a record of leap-second insertions, which cannot be
  622. predicted far in advance. Having surmounted that requirement, it does
  623. not seem odious to record the 136-year NTP epoch for such cherished
  624. timestamps upon the election of a pope, for example.
  625.  
  626. The NTP timescale is based on the UTC timescale, but not necessarily
  627. always coincident with it. At 0h on 1 January 1972 (MJD 41,317.0), the
  628. first tick of the UTC Era, the NTP clock was set to 2,272,060,800,
  629. representing the number of standard seconds since 0h on 1 January 1900
  630. (MJD 15,020.0). The insertion of leap seconds in UTC and subsequently
  631. into NTP does not affect the UTC or NTP oscillator, only the conversion
  632. to conventional civil UTC time. However, since the only institutional
  633. memory available to NTP are the UTC broadcast services, the NTP
  634. timescale is in effect reset to UTC as each timecode is received. Thus,
  635. when a leap second is inserted in UTC and subsequently in NTP, knowledge
  636. of all previous leap seconds is lost.
  637.  
  638. Another way to describe this is to say there are as many NTP timescales
  639. as historic leap seconds. In effect, a new timescale is established
  640. after each new leap second. Thus, all previous leap seconds, not to
  641. mention the apparent origin of the timescale itself, lurch backward one
  642. second as each new timescale is established. If a clock synchronized to
  643. NTP in 1991 was used to establish the UTC epoch of an event that
  644. occurred in early 1972 without correction, the event would appear
  645. sixteen seconds late relative to UTC. However, NTP primary time servers
  646. resolve the epoch using the broadcast timecode, so that the NTP clock is
  647. set to the broadcast value on the current timescale. As a result, for
  648. the most precise determination of epoch relative to the historic UTC
  649. clock, the user must subtract from the apparent NTP epoch the offsets
  650. shown in Table 2 at the relative epoches shown. This is a feature of
  651. almost all present day time-distribution mechanisms.
  652.  
  653. The chronometry involved can be illustrated with the help of Figure
  654. 4<$&fig4>, which shows the details of seconds numbering just before,
  655. during and after the last scheduled leap insertion at 23:59:59 on 31
  656. December 1990. Notice the NTP leap bits are set on the day prior to
  657. insertion, as indicated by the <169>+<170> symbols on the figure. Since
  658. this makes the day one second longer than usual, the NTP day rollover
  659. will not occur until the end of the first occurrence of second 800. The
  660. UTC time conversion routines must notice the apparent time and the leap
  661. bits and handle the timescale conversions accordingly. Immediately after
  662. the leap insertion both timescales resume ticking the seconds as if the
  663. leap had never happened. The chronometric correspondence between the UTC
  664. and NTP timescales continues, but NTP has forgotten about all past leap
  665. insertions. In NTP chronometric determination of UTC time intervals
  666. spanning leap seconds will thus be in error, unless the exact times of
  667. insertion are known.
  668.  
  669. It is possible that individual systems may use internal data formats
  670. other than the NTP timestamp format; however, a persuasive argument
  671. exists to use a two-part representation, one part for whole days (MJD or
  672. some fixed offset from it) and the other for the seconds (or some scaled
  673. value, such as milliseconds). This not only facilitates conversion
  674. between NTP and conventional civil time, but makes the insertion of leap
  675. seconds much easier. All that is required is to change the modulus of
  676. the seconds counter, which on overflow increments the day counter. This
  677. design insures that continuity of the timescale is assured, even if
  678. outside synchronization is lost before, during or after leap-second
  679. insertion. Since timestamp data are unaffected, synchronization is
  680. assured, even if timestamp data are in flight at the instant and
  681. originated before or at that instant.
  682.  
  683. @HEAD LEVEL 1 = Summary
  684.  
  685. By international agreement the primary frequency reference for our
  686. civilization is the atomic oscillator. The standard second is determined
  687. as a specified number of atomic cycles, the standard day as 86,400
  688. standard seconds and the standard (Julian) year as 365.25 standard days.
  689. The Julian clock is synchronized to atomic frequency and its timescale
  690. calibrated in standard days (JDN), where JDN 0.0 corresponds to 12h on 1
  691. January 4713 BC. While the Julian clock is elegant and everlasting, it
  692. is not useful in precision chronometric calculation of conventional
  693. civil time of day and day of year, since our solar day and solar year
  694. oscillators are slightly unstable and incommensurate.
  695.  
  696. In order to maintain the nominal solar year, the Gregorian calendar
  697. mandates the insertion of leap days, which can be determined in advance.
  698. In order to maintain the nominal solar day, leap seconds must be
  699. inserted at times which cannot be reliably determined in advance. The
  700. basis of civil time is the UTC clock, which was cloned from the Julian
  701. clock at 0h on 1 January 1972. Without knowledge of prior leap seconds,
  702. an event determined on the UTC timescale can appear many seconds late on
  703. the Julian timescale.
  704.  
  705. The NTP timescale is based on the UTC timescale and runs at atomic
  706. frequency; however, it is calibrated in standard seconds after 0h on 1
  707. January 1900. The NTP timescale is, in effect, redefined at each leap
  708. second; that is, since the NTP oscillator is phase-continuous spanning a
  709. leap second, the number of apparent NTP seconds since UTC came into
  710. being does not change. However, the number of actual UTC seconds has in
  711. fact changed. Reconciliation of the NTP and UTC timescales requires
  712. global institutional memory in the form of a table of occurrences such
  713. as shown in Table 3.
  714.  
  715. @HEAD LEVEL 1 =  References
  716.  
  717. @INDENT HEAD = [ALL74]
  718.  
  719. @INDENT =  Allan, D.W., J.H. Shoaf and D. Halford. Statistics of time
  720. and frequency data analysis. In: Blair, B.E. (Ed.). Time and Frequency
  721. Theory and Fundamentals. National Bureau of Standards Monograph 140,
  722. U.S. Department of Commerce, 1974, 151-204.
  723. @INDENT HEAD = [BEL86]
  724.  
  725. @INDENT =  Bell Communications Research. Digital Synchronization Network
  726. Plan. Technical Advisory TA-NPL-000436, 1 November 1986.
  727.  
  728. @INDENT HEAD = [CAL86]
  729.  
  730. @INDENT =  <169>Calendar.<170> The Encyclopaedia Britannica Macropaedia,
  731. 15th ed., vol. 15, pp. 460-477. Encyclopaedia Britannica Co., New York,
  732. NY, 1986.
  733.  
  734. @INDENT HEAD = [DER90]
  735.  
  736. @INDENT =  Dershowitz, N., and E.M. Reingold. Calendrical Calculations.
  737. Software Practice and Experience 20, 9 (September 1990), 899-928.
  738.  
  739. @INDENT HEAD = [DOD81a]
  740.  
  741. @INDENT =  Defense Advanced Research Projects Agency. Internet Control
  742. Message Protocol. DARPA Network Working Group Report RFC-792, USC
  743. Information Sciences Institute, September 1981.
  744.  
  745. @INDENT HEAD = [DOD81b]
  746.  
  747. @INDENT =  Defense Advanced Research Projects Agency. Internet Protocol.
  748. DARPA Network Working Group Report RFC-791, USC Information Sciences
  749. Institute, September 1981.
  750.  
  751. @INDENT HEAD = [JON83]
  752.  
  753. @INDENT =  Jones, R.H., and P.V. Tryon. Estimating time from atomic
  754. clocks. J. Research of the National Bureau of Standards 88, 1 (January-
  755. February 1983), 17-24.
  756.  
  757. @INDENT HEAD = [LIN80]
  758.  
  759. @INDENT =  Lindsay, W.C., and A.V. Kantak. Network synchronization of
  760. random signals. IEEE Trans. Communications COM-28, 8 (August 1980),
  761. 1260-1266.
  762.  
  763. @INDENT HEAD = [MAR85]
  764.  
  765. @INDENT =  Marzullo, K., and S. Owicki. Maintaining the time in a
  766. distributed system. ACM Operating Systems Review 19, 3 (July 1985), 44-
  767. 54.
  768.  
  769. @INDENT HEAD = [MIL89]
  770.  
  771. @INDENT =  Mills, D.L. Network Time Protocol (Version 2) specification
  772. and implementation. DARPA Network Working Group Report RFC-1119,
  773. University of Delaware, September 1989.
  774.  
  775. @INDENT HEAD = [MIL90a]
  776.  
  777. @INDENT =  Mills, D.L. On the accuracy and stability of clocks
  778. synchronized by the Network Time Protocol in the Internet system. ACM
  779. Computer Communication Review 20, 1 (January 1990), 65-75.
  780.  
  781. @INDENT HEAD = [MIL90b]
  782.  
  783. @INDENT =  Mills, D.L. Network Time Protocol (Version 3) specification,
  784. implementation and analysis. Electrical Engineering Department Report
  785. 90-6-1, University of Delaware, June 1990.
  786.  
  787. @INDENT HEAD = [MIL91]
  788. @INDENT =  Mills, D.L. Internet time synchronization: the Network Time
  789. Protocol. IEEE Trans. Communications 30, 9 (September 1991) (to appear).
  790.  
  791. @INDENT HEAD = [MOR83]
  792.  
  793. @INDENT =  Morley, S.G., G.W. Brainerd and R.J. Sharer. The Ancient
  794. Maya, 4th ed., pp. 598-600. Stanford University Press, Stanford, CA,
  795. 1983.
  796.  
  797. @INDENT HEAD = [MOY82]
  798.  
  799. @INDENT =  Moyer, G. The Gregorian Calendar. Scientific American 246, 5
  800. (May 1982), 144-152.
  801.  
  802. @INDENT HEAD = [NBS88]
  803.  
  804. @INDENT =  Automated Computer Time Service (ACTS). NBS Research Material
  805. 8101, U.S. Department of Commerce, 1988.
  806.  
  807. @INDENT HEAD = [POS80]
  808.  
  809. @INDENT =  Postel, J. User Datagram Protocol. DARPA Network Working
  810. Group Report RFC-768, USC Information Sciences Institute, August 1980.
  811.  
  812. @INDENT HEAD = [POS83]
  813.  
  814. @INDENT =  Postel, J. Time protocol. DARPA Network Working Group Report
  815. RFC-868, USC Information Sciences Institute, May 1983.
  816.  
  817. @INDENT HEAD = [RAM90]
  818.  
  819. @INDENT =  Ramanathan, P., K.G. Shin and R.W. Butler. Fault-tolerant
  820. clock synchronization in distributed systems. IEEE Computer 23, 10
  821. (October 1990), 33-42.
  822.  
  823. @INDENT HEAD = [RAW87]
  824.  
  825. @INDENT =  Rawley, L.A., J.H. Taylor, M.M. Davis and D.W. Allan.
  826. Millisecond pulsar PSR 1937+21: a highly stable clock. Science 238 (6
  827. November 1987), 761-765.
  828.  
  829. @INDENT HEAD = [SCI91]
  830.  
  831. @INDENT =  ScienceScope. Sounding out the threat of global warning.
  832. Science 251 (8 February 1991), 615.
  833.  
  834. @INDENT HEAD = [SHI87]
  835.  
  836. @INDENT =  Shin, K.G., and P. Ramanathan. Clock synchronization of a
  837. large multiprocessor system in the presence of malicious faults. IEEE
  838. Trans. Computers C-36, 1 (January 1987), 2-12.
  839.  
  840. @INDENT HEAD = [TIM86]
  841.  
  842. @INDENT =  <169>Time.<170> The Encyclopaedia Britannica Macropaedia,
  843. 15th ed., vol. 28, pp. 652-664. Encyclopaedia Britannica Co., New York,
  844. NY, 1986.
  845.  
  846. @INDENT HEAD = [VAS88]
  847.  
  848. @INDENT =  Vasanthavada, N., and P.N. Marinos. Synchronization of fault-
  849. tolerant clocks in the presence of malicious failures. IEEE Trans.
  850. Computers C-37, 4 (April 1988), 440-448.
  851.